 <?php 
 use Wdl\helper\sendHelper;
 ?>
 <div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 control-label">
            <span style='color:red'>*</span> 信息类型：</label>
	<div class="col-sm-9 col-xs-12">
        <div class="input-group">
            <span style="margin-right: 10px;"><input type="radio" onchange="navtype(0)" name="rent_type" {if $renttype==0}checked{/if} value="0"> 出售</span>
            <span style="margin-right: 10px;"><input type="radio" onchange="navtype(2)" name="rent_type"  {if $renttype==2}checked{/if} value="2">  出租</span>  
            <span style="margin-right: 10px;"><input type="radio" onchange="navtype(3)" name="rent_type"  {if $renttype==3}checked{/if} value="3">  转让</span>
            <span style='color:red'> 注意切换发布模式表单需要重新填写。</span>     
        </div>  
    </div>
</div>

  <div class="form-group">
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">
              <span style='color:red'>*</span>标 题：</label>
      <div class="col-sm-9 col-xs-12">
          <input type="text" name="data[title]" id="title" class="form-control"
                          placeholder="必填项（很重要！一个好的推荐广告，可以大大提升房源点击量！）"  value="{$item['title']}" />
                  
      </div>
  </div>
  <!-- 加入城市区域商圈选择 -->
  {template 'send/city_area_quan'}
    <!-- 加入城市区域商圈选择 -->
  <div class="form-group">
  
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">
              <span style='color:red'></span>地  址 ：</label>
      <div class="col-sm-9 col-xs-9">
          <input type="text" name="data[village_name]" id="village_name" class="form-control"
                          placeholder="请填写商铺地址" value="{$item['village_name']}" />
               <input id="h24" name="data[village_id]" type="hidden" value="{$item['village_id']}" class="txt" maxlength="20"/>    
      </div>
  </div>

  
  <div class="form-group">
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">
              <span style='color:red'>*</span>面 积：</label>
      <div class="col-sm-3 col-xs-3">
              <div class="input-group form-group">
          <input type="text" name="data[superficie]" id="superficie" class="form-control"
                          placeholder="请输入数字， 单位 ㎡ "  value="{$item['superficie']}" />           
            <span class="input-group-addon">㎡</span> 
              </div>
      </div>
  </div>
  
  
{if $renttype >0 }
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 control-label">
            <span style='color:red'>*</span>租 金：</label>
	<div class="col-sm-4 col-xs-4">
            <div class="input-group " style="display: flex;">
                <div>
		<input type="text" name="data[loyer]" id="loyer" class="form-control"
                        placeholder="请输入数字，0表面议"  value="{$item['loyer']}" /> 
               </div>
            <div> 
                <?php if($item['prix_unitaire']!='元/月' || $item['prix_unitaire']!='元/㎡/月') {$item['prix_unitaire']='';} ?> 
                 <input type="hidden" name="data[prix_unitaire]" id="prix_unitaire" value="{if $item['prix_unitaire']}{$item['prix_unitaire']}{else}元/月{/if}"/> 
                <select name="unitaire" onchange="$('#prix_unitaire').val(this.value)">
                         <option {if $item['prix_unitaire']=='元/月'}selected{/if} value="元/月">元/月</option>
                        <option {if $item['prix_unitaire']=='元/㎡/月'}selected{/if}  value="元/㎡/月">元/㎡/月</option> 
                </select>
            </div> 
            </div>
	</div>
</div>
 
    {if $renttype==3}  
    <div class="form-group">
        <label class="col-xs-12 col-sm-3 col-md-2 control-label">
                <span style='color:red'></span>转让费： </label>
        <div class="col-sm-4 col-xs-4">
                <div class="input-group form-group">
            <input type="text" name="data[dong]" id="dong" class="form-control"
                            placeholder="请输入数字，0表面议"  value="{$item['dong']}" /> 
                    <span class="input-group-addon">万元</span> 
            
                </div>
        </div>
    </div>
    {/if}

{else}
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 control-label">
            <span style='color:red'>*</span>售 价：</label>
	<div class="col-sm-4 col-xs-4">
            <div class="input-group form-group">
		<input type="text" name="data[loyer]" id="loyer" class="form-control"
                        placeholder="请输入数字，0表面议"  value="{$item['loyer']}" /> 
                <span class="input-group-addon">万元</span> 
	 <input type="hidden" name="data[prix_unitaire]" id="prix_unitaire" value="万"/> 	
            </div>
	</div>
</div>

{/if} 

<!-- 商品类型 -->
   
  <div class="form-group">
    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
            <span style='color:red'></span>商铺类型：</label>
    <div class="col-sm-2 col-xs-2">
            <div class="input-group form-group">
        <?php  echo
 form_element::select($selects['sptype'],'data[house_type]','house_type',$item['house_type']);
 ?>
         
            </div>
    </div>        
</div>
<!--生意类型-->
<div class="form-group">
    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
        <span style='color:red'></span>行业分类：</label>
    <div class="col-sm-9 col-xs-4">
              <div class="input-group form-group">
          <span style="display:table-cell; ">  
      <?php  
      $item['hangye'] = explode(",", $item['prule']);
      echo form_element::select($selects['hangye'],'hangye','hangye',$item['hangye'][0]); ?>  
          </span>
          <span style="display:table-cell; "> 
              <select name="jingyin" id="jingyin">
                     {if $item['hangye'][1]}
                     <option value="{$item['hangye'][1]}">{$item['hangye'][1]}</option>
                     {else}
                     <option value="">-请选择经营类型-</option>
                     {/if}
                 </select></span>
           
              </div>
    </div>
       
</div> 
<!--生意转让-->
<script>
 function init_hangye_jingyin(hangye){
            var areas = {php echo json_encode($selects['jingyin'])};
            var house_quan = "{$item['hangye'][1]}";
            var curr = hangye;
            if(isnull(areas[curr])){
                return ;
            }
            var quan = areas[curr];
            var html = "";
            for(var q in quan){
                var s = quan[q]==house_quan ? 'selected':'';
                html+= '<option '+ s +' value="'+quan[q]+'">'+quan[q]+'</option>';
            }
            $("#jingyin").html(html);
        }  
 $(function () {

        /*绑定hangye 的change事件*/
        init_hangye_jingyin('{$item['hangye'][0]}');
        $("#hangye").change(function(){
           init_hangye_jingyin(this.value);

        })
});       
    </script>

     <!--//-->
  <div class="form-group">
    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
            <span style='color:red'></span>楼 层：</label>
    <div class="col-sm-2 col-xs-2">
            <div class="input-group form-group">
        <input type="text" name="data[storey]" id="storey" class="form-control"
                        placeholder="第几层"  value="{$item['storey']}" onkeyup="this.value=this.value.replace(/\D/g,'')" size="1" maxlength="3" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>           
          <span class="input-group-addon">层</span> 
            </div>
    </div>
        <div class="col-sm-2 col-xs-2">
            <div class="input-group form-group">
        <input type="text" name="data[total_storey]" id="total_storey" class="form-control"
                        placeholder="共几层"  value="{$item['total_storey']}" onkeyup="this.value=this.value.replace(/\D/g,'')" size="1" maxlength="3" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>           
          <span class="input-group-addon">共几层</span>  
            </div>
    </div>
</div>

<div class="form-group">
    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
        <span style='color:red'>*</span> 配套特色：</label>
    <div class="col-sm-8 col-xs-12">
      <div class="tese">
    <?php

    echo form_element::checkbox($selects['pumian_tese'],'disposition','disposition',$item['disposition']);
    ?>
        </div>
    </div>
   </div>
  
  <div class="form-group">
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">有效期至：</label>
      <div class="col-sm-4 col-xs-6">
          {php echo tpl_form_field_date('endtime', !empty($item['endtime']) ? date('Y-m-d H:i',$item['endtime']) : date('Y-m-d H:i'), 1)}
  
      </div>
  </div>
  
    
  <div class="form-group">
    <label class="col-xs-12 col-sm-3 col-md-2 control-label">
            <span style='color:red'></span>房源编号：</label>
    <div class="col-sm-6 col-xs-6">
        <input type="text" name="data[house_sno]" id="house_sno" class="form-control"
                        placeholder="请输入公司房源编号"  value="{$item['house_sno']}" />
    </div>
</div>

  <div class="form-group">
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">
              <span style='color:red'></span>经纪人：</label>
      <div class="col-sm-4 col-xs-6">
              <div class="input-group form-group">
            <?php  echo
   form_element::select($brokers,'data[broker_id]','broker_id',$item['broker_id']);
   ?>        
             
              </div>
              <p>添加经纪人后联系人信息不用填写。</p>
      </div>
      
          
  </div>
  <div class="form-group">
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">
              <span style='color:red'></span>联系信息</label>
      <div class="col-sm-4 col-xs-6">
              <div class="input-group form-group">
          <input type="text" name="data[publish_name]" id="publish_name" class="form-control"
                          placeholder="联系人"  value="{$item['publish_name']}" />           
            <span class="input-group-addon">名称</span> 
              </div>
      </div>
          <div class="col-sm-4 col-xs-6">
              <div class="input-group form-group">
          <input type="text" name="data[linkphone]" id="linkphone" class="form-control"
                          placeholder="手机号"  value="{$item['linkphone']}"/>           
            <span class="input-group-addon">手机号</span>  
              </div>
      </div>
  </div>
  
  <div class="form-group">
  
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">形象图：</label>
  
      <div class="col-sm-9 col-xs-12">
  
          {php echo tpl_form_field_image('thumb', $item['thumb'], '', array('extras' => array('text' => 'readonly')))}
  
      </div>
  
  </div>
  
  <div class="form-group">
  
      <label class="col-xs-12 col-sm-3 col-md-2 control-label">铺面图片：</label>
  
      <div class="col-sm-9 col-xs-12">
  
          {php echo tpl_form_field_multi_image('thumbs',$piclist)}
  
      </div>
  
  </div>